<%@ page import="org.subject.entity.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--引入 jstl--%>
<%@include file="common/tag.jsp" %>
<!DOCTYPE html>
<%-- 获取资源根路径--%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <title>个人中心</title>
    <%@include file="common/head.jsp" %>
    <script src="/./resource/js/list.js"></script>
    <style>
        a {
            color: #666;
        }

        html, body {
            margin: 0;
            padding: 0;
            height: 100%;
        }

        #container {
            min-height: 100%;
            height: auto !important;
            height: 100%; /*IE6不识别min-height*/
            position: relative;
        }

        #page {
            width: 100%;
            margin-bottom: 50px; /*等于footer的高度*/
        }
    </style>
    <style>
        .fl {
            float: left;
            display: inline;
        }

        .nav_module {
            margin-bottom: 15px;
        }

        .nav_module li {
            list-style: none;
        }

        .nav_module li.dt {
            height: 28px;
            line-height: 28px;
            font-weight: bold;
        }

        .nav_module ul li a {
            height: 28px; /*设置高度为28px*/
            line-height: 28px; /*设置行距为28px，让文字在每行的中间位置*/
            color: #000; /*文字颜色是白色*/
            margin: 5px 10px;
            font-size: 12px; /*用12号字*/
            display: block; /*这个比较关键，因为a本身就是联级元素，本身不具有宽高，用这个把它变成块级元素，这样前面设置的宽和高就能起作用了*/
            text-align: center; /*让文本居中*/
            text-decoration: none; /*去掉下划线*/
        }

        .pageNum {
            margin-top: 20px;
            text-align: center;
        }

        .b_mainBox_hd li {
            list-style: none;
            float: left;
        }

        .bNav {
            margin-top: 10px;
            margin: auto;
            background: #F1F1F1;
            /*text-align:center;*/
        }

        .bNav ul {
            padding: 4px 20px;
            margin: 0;
            overflow: hidden;
        }

        .bNav ul li {
            display: inline;
            padding: 0;
        }
    </style>
    <%
        User user = (User) session.getAttribute("user");
    %>
</head>
<body background="/./resource/images/bg.jpg" style="background-size: cover;background-repeat: no-repeat;">
<%--页面显示部分--%>
<div id="container" class="container">
    <jsp:include page="common/Top.jsp"/>
    <div id="page" class="panel panel-default">
        <div class="panel-heading" hidden>
            <h5>最新公告</h5>
        </div>
        <div class="panel-body">
            <!--左侧菜单-->
            <div class="col-md-2 fl">
                <ul class="nav_module">
                    <li class="dt">账号设置</li>
                    <li ng-hide="CurrentUser.IsShop"><a href="/user/detail?userId=<%=user.getUserId()%>">个人信息</a></li>
                </ul>
                <ul class="nav_module">
                    <li class="dt">竞赛信息</li>
                    <c:choose>
                        <c:when test="${user.getUserRole() == 2 || user.getUserRole()==1}">
                            <li ng-hide="CurrentUser.IsShop"><a href="/message/publishHistory?userId=${user.userId}">发布竞赛历史</a>
                            </li>
                        </c:when>
                    </c:choose>
                    <c:choose>
                        <c:when test="${user.getUserRole() == 2 || user.getUserRole()==1}">
                            <li><a href="/article/articlePage">竞赛通知管理</a></li>
                        </c:when>
                    </c:choose>
                    <c:choose>
                        <c:when test="${user.getUserRole()==1}">
                            <li><a href="/message/messageByFId?type=1&facultyId=${user.facultyId}">学生参赛信息</a></li>
                        </c:when>
                    </c:choose>
                    <c:choose>
                        <c:when test="${user.getUserRole() == 2}">
                            <li><a href="/article/articlePage">本院学生参赛</a></li>
                        </c:when>
                    </c:choose>
                    <c:choose>
                        <c:when test="${user.getUserRole() == 3}">
                            <li ng-hide="CurrentUser.IsShop"><a href="#">已报竞赛</a></li>
                        </c:when>
                    </c:choose>
                    <c:choose>
                        <c:when test="${user.getUserRole() == 3}">
                            <li ng-hide="CurrentUser.IsShop"><a href="#">竞赛历史</a></li>
                        </c:when>
                    </c:choose>
                </ul>
            </div>
            <div class="col-md-10">
                <div class="bNav">
                    <ul>
                        <li><a href="/user/detail?userId=<%=user.getUserId()%>">个人中心</a></li>
                        <li><span> > </span></li>
                        <li>竞赛信息</li>
                        <li><span> > </span></li>
                        <li>发布竞赛历史</li>
                    </ul>
                </div>
                <br/>

                <div class="tab-content" style="margin-top: 20px">
                    <form id="mainForm">
                        <div class="rightCont">
                            <div class="zixun fix" style="margin-top: 20px">
                                <table class="tab2" width="100%">
                                    <thead>
                                    <tr>
                                        <th style="height: 40px">序号</th>
                                        <th>标题</th>
                                        <th>发布时间</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${messageList}" var="message" varStatus="status">
                                        <tr
                                                <c:if test="${status.index % 2 != 0}">style='background-color:#ECF6EE;'</c:if>>
                                            <td style="height: 40px">${status.index + 1}</td>
                                            <td>${message.messageTitle}</td>
                                            <td><fmt:formatDate value="${message.createTime}"
                                                                pattern="yyyy-MM-dd"/></td>
                                            <td>
                                                <a href="/regist/listByFId?messageId=${message.messageId}&facultyId=${user.facultyId}&type=${user.getUserRole()}">查看报名学生</a>&nbsp;&nbsp;&nbsp;
                                            </td>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>
                                <div class='page fix'>
                                    <div class='page fix pageNum'>
                                        共 <b>${page.totalNumber}</b> 条
                                        <c:if test="${page.currentPage != 1}">
                                            <a style="color: #2777ad" href="<%= basePath %>message/page?page=1"
                                               class='first'>首页</a>
                                            <a style="color: #2777ad"
                                               href="<%= basePath %>message/page?page=${page.currentPage-1}"
                                               class='pre'>上一页</a>
                                        </c:if>
                                        当前第<span>${page.currentPage}/${page.totalPage}</span>页
                                        <c:if test="${page.currentPage != page.totalPage}">
                                            <a style="color: #2777ad"
                                               href="<%= basePath %>message/list?page=${page.currentPage+1}"
                                               class='next'>下一页</a>
                                            <a style="color: #2777ad"
                                               href="<%= basePath %>message/page?page=${page.totalPage}"
                                               class='last'>末页</a>
                                        </c:if>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <jsp:include page="common/footer.jsp"/>
</div>
</body>
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</html>

<%--<div class="container persontop">
    <ul class="nav nav-tabs" role="tablist" id="tab-list">
        <li class="active"><a href="" role="tab">个人信息</a></li>
        <li><a href="/user/edit?userId=<%=user.getUserId()%>" role="tab">编辑个人信息</a></li>
        <c:choose>
            <c:when test="${user.getUserRole() == 2}">
                <li><a href="/message/publish?userId=<%=user.getUserId()%>" role="tab">发布竞赛</a></li>
            </c:when>
        </c:choose>
        <li><a href="#shuiliandong" role="tab">竞赛历史</a></li>
        <c:choose>
            <c:when test="${user.getUserRole() == 1}">
                <li><a href="#shuiliandong" role="tab">管理竞赛</a></li>
            </c:when>
        </c:choose>
    </ul>


</div>--%>
